package phan.connection;

import java.util.*;

public class PaiementBean {

    private String login;
    private String stockagenom;
    private String email;
    private String serie;
    private String max;
    private int i;
private String notify;
    public PaiementBean() {
        max="";
        login = "";
        notify="";
        stockagenom = "";
        email = "";

        serie = "";
        errors = new Hashtable();
    }

    public int checkLogin(String login)
    {
        MySQLDBConnector conn = new MySQLDBConnector();
        int i =conn.getUserID(login);
        System.out.print(i);
        return i;
    }

    public boolean validate() {
		boolean allOk=true;
        System.out.print("notify la" +getNotify());

         if (serie.equals("")&&max.equals("")) {
			errors.put("serie","Veuillez choisir votre mode de paiement et le montant");
			serie="";
			allOk=false;
		}
        if (serie.equals("")&&!max.equals("")) {
			errors.put("serie","Veuillez choisir votre mode de paiement");
			serie="";
			allOk=false;
		}
         if (max.equals("")&&!serie.equals("")) {
			errors.put("max","Veuillez choisir le montant");
			//max="";
			allOk=false;
		}
        
       
        return  allOk;
    }
    private Hashtable errors;

    public String getErrorMsg(String s) {
        String errorMsg = (String) getErrors().get(s.trim());
        return (errorMsg == null) ? "" : errorMsg;
    }

    /**
     * @return the catalog
     */

    /**
     * @return the ville
     */
    /**
     * @return the errors
     */
    public Hashtable getErrors() {
        return errors;
    }

    /**
     * @param errors the errors to set
     */
    public void setErrors(Hashtable errors) {
        this.errors = errors;

    }

    /**
     * @return the login
     */
    public String getLogin() {
        return login;
    }

    /**
     * @param login the login to set
     */
    public void setLogin(String login) {
        this.login = login;
    }

    /**
     * @return the stockagenom
     */
    public String getStockagenom() {
        return stockagenom;
    }

    /**
     * @param stockagenom the stockagenom to set
     */
    public void setStockagenom(String stockagenom) {
        this.stockagenom = stockagenom;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the serie
     */
    public String getSerie() {
        return serie;
    }

    /**
     * @param serie the serie to set
     */
    public void setSerie(String serie) {
        this.serie = serie;
    }

    /**
     * @return the i
     */
    public int getI() {
        return i;
    }

    /**
     * @param i the i to set
     */
    public void setI(int i) {
        this.i = i;
    }

    /**
     * @return the notify
     */
    public String getNotify() {
        return notify;
    }

    /**
     * @param notify the notify to set
     */
    public void setNotify(String notify) {
        this.notify = notify;
    }

    /**
     * @return the max
     */
    public String getMax() {
        return max;
    }

    /**
     * @param max the max to set
     */
    public void setMax(String max) {
        this.max = max;
    }
}

